import request from '@/utils/request' 

// /admin/product/baseTrademark/remove/{id}
// 删除BaseTrademark

// POST /admin/product/baseTrademark/save
// 新增BaseTrademark

// PUT /admin/product/baseTrademark/update
// 修改BaseTrademark

// GET /admin/product/baseTrademark/{page}/{limit}

// 获取所有的品牌数据   GET     /admin/product/baseTrademark/getTrademarkList


export interface TrademarkModel {
    id?:number,
    tmName:string,
    logoUrl:string
}

export type TrademarkList = TrademarkModel[]

export interface TrademarkPageModel {
    current:number,
    pages:number,
    records:TrademarkList,
    searchCount:boolean,
    size:number,
    total:number
}

export default {
    // 查询分页
    getPage(page:number,limit:number){
        return request.get<any,TrademarkPageModel>(`/admin/product/baseTrademark/${page}/${limit}`)
    },
    // 保存品牌
    save(data:TrademarkModel){
        return request.post<any,null>(`/admin/product/baseTrademark/save`,data)
    },
    // 更新
    update(data:TrademarkModel){
        return request.put(`/admin/product/baseTrademark/update`,data)
    },
    // 删除
    delete(id:number){
        return request.delete<any,null>(`/admin/product/baseTrademark/remove/${id}`)
    },
    // 获取所有的品牌数据
    getTrademarkList(){
        return request.get<any,TrademarkList>(`/admin/product/baseTrademark/getTrademarkList
        `)
    }
}